﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.Linq;

namespace DocTes.Jerarquias
{
	public partial class DataClassesArbolDataContext
	{

		/// <summary>
		/// Se sobreescribe el Submit Changes para la ultima fecha de actualización
		/// </summary>
		/// <param name="failureMode"></param>
		public override void SubmitChanges(ConflictMode failureMode)
		{
			ChangeSet cambios = this.GetChangeSet();

			
			
			try
			{
				base.SubmitChanges(ConflictMode.ContinueOnConflict);
			}
			catch (ChangeConflictException)
			{
				foreach (ObjectChangeConflict conflicto in this.ChangeConflicts)
				{
					conflicto.Resolve(RefreshMode.OverwriteCurrentValues, true);
				}
				this.SubmitChanges();
			}
		}
	}
}
